package com.rpc.provider;

import com.rpc.core.RpcConfig;
import com.rpc.core.server.EnableRpcServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@EnableRpcServer
@SpringBootApplication(scanBasePackages = {"com.rpc.provider"})
public class ProviderApplication {

	public static void main(String[] args) {
		SpringApplication.run(ProviderApplication.class, args);
	}

	@Autowired
	private RpcConfig rpcConfig;

	@RequestMapping("/test")
	public String test() {
		return rpcConfig.getHost();
	}
}
